3.7 [Packages] Sections

These are optional sections. If there are files listed under a [Sources] section, then the INF file is required to list the MdePkg/MdePkg.dec file as the first file in a [Packages] section. This section is also required if the module uses PCDs for both source and the binary "As Built" INF modules.

Summary

Defines the [Packages] section tag that is used in EDK II module INF files. Each entry in this section contains a directory name, forward slash character and the name of the DEC file contained in the directory name.

The order in which packages are listed may be relevant. Said order specifies in what order include path statements are generated for a compiler. This may help resolve header file name collisions between packages (although such collisions are normally not expected). For setting specific include path priorities, the packages may be listed in matching order in the INF file. Listing a package earlier will cause a compiler to consider include paths from that package earlier.

If there are PCDs listed in the generated "As Built" INF, the packages that declare any PCDs must be listed in this section.

Each package filename must be listed only once per section. Package filenames listed in architectural sections are not permitted to be listed in the common architectural section.

The "common" architecture modifier in a section tag must not be combined with other architecture type; doing so will result in a build break.

Packages listed under the "common" architecture section must not be listed in sections that have other architecture modifiers.

Prototype

<Packages>           ::= "[Packages" [<com_attrs>] "]" <EOL> <Statements>*
<com_attrs>          ::= {".common"} {<attrs>}
<attrs>              ::= <Archs> ["," <TS> "Packages" <Archs>]
<Archs>              ::= "." <arch>
<Statements>         ::= {<MacroDefinition>} {<PkgStatements>}
<PkgStatements>      ::= <TS> <Filename> [<Field2>] <EOL>
<Field2>             ::= <FS> <FeatureFlagExpress>
<FeatureFlagExpress> ::= <Boolean>

Parameters

Filename

Paths listed in the [Packages] section contain a directory name, forward slash character and the name of the DEC file contained in the directory name. Use of "..", "." and "../" in the directory path is not permitted. Use of an absolute path is prohibited.

FeatureFlagExpress

When present, the feature flag expression determines whether the entry line is valid. If the feature flag expression evaluates to FALSE, this entry will be ignored by the EDK II build tools.

Example

[Packages]
  MdePkg/MdePkg.dec
  MdeModulePkg/MdeModulePkg.dec

[Packages.IA32]
  DEFINE CPUS = IA32FamilyCpuPkg
  $(CPUS)/DualCore/DualCore.dec